package org.chs.ts.base.batch.vo.entity;

import lombok.Getter;
import lombok.Setter;
import org.chs.ts.base.batch.exec.entity.BatchClearBasicTaskExec;

/**
 * @author wuwei
 * @date 2024/11/22
 * @apiNote
 */
@Getter
@Setter
public class BatchExecResp {
    /**
     * 跑批组代码
     */
    private String taskGroup;

    /**
     * 任务ID
     */
    private String taskId;

    /**
     * 任务执行ID
     */
    private String taskExecId;

    /**
     * 执行优先级
     */
    private Integer execOrder;

    /**
     * 连接超时时间
     */
    private Integer connectTimeout;

    /**
     * 执行超时时间
     */
    private Integer executeTimeout;

    /**
     * 是否可重复执行
     */
    private String canReplay;

    /**
     * 是否分片任务
     */
    private String isSlice;



    /**
     * 任务服务处理类
     */
    private String sliceServiceClass;

    /**
     * 返回代码
     */
    private String rtnCode;

    /**
     * 返回说明
     */
    private String rtnDesc;

    /**
     * 跑批系统代码
     */
    private String batchSysCode;

    public BatchExecResp() {
    }

    public BatchExecResp(String rtnCode, String rtnDesc) {
        this.rtnCode = rtnCode;
        this.rtnDesc = rtnDesc;
    }

    public BatchExecResp(String taskExecId, String rtnCode, String rtnDesc) {
        this.taskExecId = taskExecId;
        this.rtnCode = rtnCode;
        this.rtnDesc = rtnDesc;
    }

    public BatchExecResp(String taskGroup, String taskId, String taskExecId, String rtnCode, String rtnDesc, String batchSysCode) {
        this.taskGroup = taskGroup;
        this.taskId = taskId;
        this.taskExecId = taskExecId;
        this.rtnCode = rtnCode;
        this.rtnDesc = rtnDesc;
        this.batchSysCode = batchSysCode;
    }

    public BatchExecResp(BatchClearBasicTaskExec clearBasicTaskExec, String rtnCode, String rtnDesc){

        this.setTaskGroup(clearBasicTaskExec.getTaskGroup());
        this.setTaskId(clearBasicTaskExec.getTaskId());
        this.setTaskExecId(clearBasicTaskExec.getTaskExecid());
        this.setExecOrder(clearBasicTaskExec.getExecOrder());
        this.setConnectTimeout(clearBasicTaskExec.getProcConnectTimeout());
        this.setExecuteTimeout(clearBasicTaskExec.getProcExecTimeout());
        this.setCanReplay(clearBasicTaskExec.getCanReplay());
        this.setIsSlice(clearBasicTaskExec.getIsSlice());
        this.setSliceServiceClass(clearBasicTaskExec.getSliceServiceClass());
        this.setBatchSysCode(clearBasicTaskExec.getBatchSysCode());

        this.rtnCode = rtnCode;
        this.rtnDesc = rtnDesc;

    }


}
